Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] Apply code checks/format #46999

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Conversation

smuzaffar
Copy link
Contributor

PGO changes ( e.g. using relative source path instead of full path ) broke scram build code-checks rule. So it has not been running properly on PR. code-format was working but only code-checks i.e. clang-tidy did not work as it required correct compiler_command.json with correct source file paths.

Build rules are fixed now, so this PR applies code-checks ( and format) for those files which were merged with proper code-checks

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 18, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46999/43085

ERROR: Build errors found during clang-tidy run.

/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02868/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../include/c++/12.3.1/bits/stl_construct.h:115:4: error: no matching function for call to 'construct_at' [clang-diagnostic-error]
  115 |           std::construct_at(__p, std::forward<_Args>(__args)...);
      |           ^~~~~~~~~~~~~~~~~
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02868/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../include/c++/12.3.1/bits/alloc_traits.h:635:9: note: in instantiation of function template specialization 'std::_Construct<std::basic_ofstream<char>, const char *, const std::_Ios_Openmode &, edm::service::close_and_delete>' requested here
--
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02868/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../include/c++/12.3.1/bits/stl_construct.h:119:25: error: no matching constructor for initialization of 'std::basic_ofstream<char>' [clang-diagnostic-error]
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |                         ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02868/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../include/c++/12.3.1/fstream:795:7: note: candidate constructor not viable: requires at most 2 arguments, but 3 were provided
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@@ -632,7 +633,7 @@ namespace edm {
}

void ELoutput::changeFile(const std::string& filename) {
os.reset(new std::ofstream(filename.c_str(), std::ios /*_base*/ ::app), close_and_delete());
os = std::make_shared<std::ofstream>(filename.c_str(), std::ios /*_base*/ ::app, close_and_delete());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@makortel , as std::make_shared does not allow a custom deleter. so should I revert this change and add // NOLINT ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as std::make_shared does not allow a custom deleter. so should I revert this change and add // NOLINT ?

Yes, this change should be reverted.

Copy link
Contributor

@makortel makortel Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So clang-tidy made a change that it then failed to process? :(

@@ -214,7 +213,7 @@ namespace edm {
std::optional<ProductProvenance> productProvenance) const {
assert(!bd.produced());
if (productProvenance) {
productProvenanceRetrieverPtr()->insertIntoSet(std::move(*productProvenance));
productProvenanceRetrieverPtr()->insertIntoSet(*productProvenance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note for future reference, ProductProvenance is as efficient to copy as it is to move.

@smuzaffar
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @smuzaffar for master.

It involves the following packages:

  • DataFormats/Provenance (core)
  • FWCore/Framework (core)
  • FWCore/MessageService (core)
  • FWCore/Modules (core)
  • FWCore/Services (core)
  • IOPool/Streamer (core)
  • PerfTools/AllocMonitorPreload (core)
  • Utilities/XrdAdaptor (core)

@Dr15Jones, @makortel, @smuzaffar can you please review it and eventually sign? Thanks.
@felicepantaleo, @fwyzard, @makortel, @missirol, @mmusich, @rovere, @wddgit this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@@ -148,7 +148,7 @@ namespace {
}
};

static ThreadTracker& getTracker() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this code change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this all inside an anonymous namespace anyway ?

Copy link
Contributor Author

@smuzaffar smuzaffar Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this all inside an anonymous namespace anyway ?

yes @fwyzard. clang-tidy removed the static due to exact same reason (https://clang.llvm.org/extra/clang-tidy/checks/readability/static-definition-in-anonymous-namespace.html)

warning: 'getTracker' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have looked closer. I had thought the function was actually a member function of a class, not a free function.

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-39712b/43557/summary.html
COMMIT: c0045dc
CMSSW: CMSSW_15_0_X_2024-12-18-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/46999/43557/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 4 lines to the logs
  • Reco comparison results: 9 differences found in the comparisons
  • DQMHistoTests: Total files compared: 46
  • DQMHistoTests: Total histograms compared: 3510017
  • DQMHistoTests: Total failures: 451
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3509546
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 45 files compared)
  • Checked 202 log files, 172 edm output root files, 46 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

Comparison differences are related to #46416

@makortel
Copy link
Contributor

+core

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @mandrenguyen, @antoniovilela, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 830e6ae into cms-sw:master Dec 20, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants